(function($,plugin){var data={},id=1,etid=plugin+'ETID';$.fn[plugin]=function(speed,group){id++;group=group||this.data(etid)||id;speed=speed||200;if(group===id)this.data(etid,group);this._hover=this.hover;this.hover=function(over,out){over=over||$.noop;out=out||$.noop;this._hover(function(event){var elem=this;clearTimeout(data[group]);data[group]=setTimeout(function(){over.call(elem,event)},speed)},function(event){var elem=this;clearTimeout(data[group]);data[group]=setTimeout(function(){out.call(elem,event)},speed)});return this};return this};$.fn[plugin+'Pause']=function(){clearTimeout(this.data(etid));return this};$[plugin]={get:function(){return id++},pause:function(group){clearTimeout(data[group])}}})(jQuery,'mouseDelay'); var whirMain = { top: function() { $("#m" + m).addClass("aon"); whirOpen.toggle(".open-search",'.top-search') whirSearch.one("#TopBtn", "TopKey", "璇疯緭鍏ュ叧閿瘝", "杈撳叆鍏抽敭璇嶆悳绱紒", "杈撳叆鐨勫叧閿瘝瀛楁暟涓嶈杩囧锛?, "鎮ㄨ緭鍏ョ殑鍐呭瀛樺湪鐗规畩瀛楃锛?, searchpath) //鍒ゆ柇鏄惁鏈変笅鎷 var _li=$("menu li") _li.each(function(){ var n=$(this).find("dd").length if(n>=1){ $(this).addClass("has-sub"); } //鏀瑰彉閫変腑 榧犳爣缁忚繃鍘绘帀褰撳墠鏍忕洰閫変腑 $(this).hover(function(){ $(this).addClass("aon").siblings().removeClass("aon"); },function(){ $(this).removeClass("aon"); $("#m"+m).addClass("aon"); }); }); $(function ($) { $(window).on("resize", function () { if($(window).width()>1025){ whirMain.pc(); } else{ whirMain.wap(); } }).trigger("resize"); }); $("header").hover(function () { $(this).addClass("hover") },function(){ var stop=$(window).scrollTop() if (stop < $(".home-ban").height()||stop < $(".page-ban").height()) { $(this).removeClass("hover") } }) $(window).scroll(function () { var before = $(window).scrollTop(); if ($(window).scrollTop() > 0) { $("header").addClass("hover") } else { $("header").removeClass("hover") } $(window).scroll(function () { var after = $(window).scrollTop(); if (before < after) { $("header").addClass("Down"); before = after; } if (before > after) { $("header").removeClass("Down"); before = after; } }) }) }, pc:function(){ $(".has-sub").mouseDelay(false).hover(function(){ $(this).find(".sub").slideDown(300); $(this).siblings().find(".sub").slideUp(300); //鍒ゆ柇涓嬫媺妗嗗唴瀹瑰搴﹁秴鍑哄睆骞 var subw=$(this).find(".sub").outerWidth(), this_pleft=$(this).position().left+$(this).outerWidth(), ww=$(window).width(), right_w=ww-this_pleft //console.log(this_pleft,right_w) if(subw>=right_w){ var leftcss=subw-right_w $(this).find(".sub").css("left",-leftcss); }else{ $(this).find(".sub").css("left",""); } //鍒ゆ柇涓嬫媺妗嗗唴瀹瑰搴﹁秴鍑哄睆骞 END },function(){ $(this).find(".sub").slideUp(300); }); $("menu").mouseleave(function(){ $(this).find(".sub").slideUp(300); }); }, wap:function(){ $("menu li,menu").unbind(); $(".has-sub .op").remove(); $(".has-sub").find("aside").append(""); $('.op').click(function(){ $(this).toggleClass("click"); $(this).parent().next(".sub").slideToggle(); $(this).parent().parent().siblings().find(".op").removeClass("click"); $(this).parent().parent().siblings().find(".sub").slideUp(); }); //鎵撳紑绉诲姩绔鑸 $(".open-menu").unbind(); whirOpen.open(".open-menu","body","menu-show","menu"); //end }, bottom: function() { whirMain.top(); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ new WOW().init(); }; //鏁寸珯鏃犲浘澶勭悊 setTimeout(function(){ $.each($("img"), function(i, n) { $(n).on('error', function() { n.src = nopicpath; $(this).parent(".Ispic").css("background-image","url("+nopicpath+")") }); n.src = n.src; }); $(".Ispic").each(function(){ var img=$(this).css("background-image") var nop='url("'+ location.protocol +'//'+ location.hostname +''+picpath+'")' if(img==nop){ $(this).css("background-image","url("+nopicpath+")") } }) },1000) //杩斿洖椤堕儴 $(window).scroll(function() { var stop = $(document).scrollTop() var wh = $(window).height() if (stop > wh) { $(".gettop").fadeIn(); } else { $(".gettop").fadeOut(); } }); $(".gettop").click(function() { $('body,html').animate({ scrollTop: 0 }, 500) }); }, nav:function(a,b){ // a 鏍忕洰id // b绫诲埆id if(b!=''){ if($("#nav"+b).length==0){ var navid=a }else{ var navid=b } } else{ var navid=a||0 } $("#nav"+navid).addClass("aon") if($(window).width()<=1024){ if($("#nav"+navid).length!=0){ var liofl=$("#nav"+navid).offset().left var liw=$("#nav"+navid).outerWidth() var ulw= $(".nav-menu ul").outerWidth() if(liofl + liw > ulw){ $(".nav-menu ul").animate({scrollLeft:liofl},0) } } } }, about:function(){ //鍒ゆ柇閰嶅浘涓嶅瓨鍦 鍙栨秷宸﹀彸缁撴瀯 if($(".about-Main .box-1 .right li").length==0){ $(".about-Main .box-1 .right").remove() $(".about-Main .box-1 .left").removeClass("fl") } }, honor:function(a,b){ $('html head').append("") $(".fancybox").fancybox() if(a=='slicktrue'){ whirMain.slicktrue() //绗簩椤 缃《鏁版嵁闅愯棌 whirMain.noIstop(b,".honor-Istop"); } }, slicktrue:function(){ $('.slider-for').slick({ fade: true, autoplay: true, //infinite: false, appendArrows:$(".slider-nav"), asNavFor: '.slider-nav .slider' }); $('.slider-nav .slider').slick({ arrows: false, //infinite: false, slidesToShow: 4, vertical: true, asNavFor: '.slider-for', focusOnSelect: true, responsive: [ {breakpoint: 1024,settings: {vertical: false,}}, {breakpoint: 480,settings: {slidesToShow: 3,vertical: false,}} ] }); }, noIstop:function(b,v){ if(b!=1&&b!=''){ $(v).hide(); } }, feedBack:function(){ $(".form li").each(function () { var tips = $(this).find("label"); var input = $(this).find(".text"); input.val(""); input.focus(function () { tips.hide(); }); input.blur(function () { var val = $(this).val(); if (val == "") { tips.show(); } }); tips.click(function () { $(this).hide(); $(this).next(".text").focus(); }); }); }, news:function(b,v){ whirMain.noIstop(b,v); if($(".news-top .slider .item").length==0){ $(".news-top").hide() }else{ $('.news-top .slider').slick({ slidesToShow: 3, arrows:false, dots:true, responsive: [ {breakpoint: 768,settings: {slidesToShow: 2}}, {breakpoint: 480,settings: {slidesToShow: 1}} ] }) } if($(".news-list .url").length==0){ $('.Pages').remove() } }, business:function(b,v,colid){ whirMain.noIstop(b,v); if($(".business-list li").length==0){ $('.Pages').remove() } whirMain.addALL(colid) }, businessInfo:function(colid){ whirMain.slicktrue() whirMain.addALL(colid) }, addALL:function(colid){ $(".nav-menu ul").prepend("
  • 鍏ㄩ儴
  • ") }, technology:function(b,v){ whirMain.noIstop(b,v); if($(".news-text ol").length==0){ $('.Pages').remove() } $(".news-slider .slider").slick({ dots:true, arrows:false, autoplay:true, speed:800 }) }, job:function(){ // $(".job-list .list").eq(0).find(".con").show(); $(".job-list .list").eq(0).find(".type").attr("id","On"); //鐐瑰嚮鏄剧ず $(".job-list .list").each(function() { $(this).find(".type").click(function(){ $(this).next(".con").toggle(); $(this).parent(".list").siblings().find(".con").hide(); }); }); }, home:function(){ $('.img-slider .slider').slick({ slidesToShow: 4, arrows: false, responsive: [ {breakpoint: 1024,settings: {autoplay: true,slidesToShow: 3}} ] }); $('.Floor003105 .slider .ul').slick({ slidesToShow: 1, centerMode: true, centerPadding: 0, autoplay: true, speed:1000 }); $(".home-news .tabs li").hover(function(){ var e=$(this).index() $(this).addClass("on").siblings().removeClass("on") $(".home-news .tabs-ul ul").eq(e).addClass("show").siblings().removeClass("show") }); $(".home-news .tabs li").eq(0).addClass("on").siblings().removeClass("on") $(".home-news .tabs-ul ul").eq(0).addClass("show").siblings().removeClass("show") }, homeBan:function(){ $(".home-ban .slider").slick({ autoplay:true, arrows:false, speed:1200, fade:true }); $(".home-ban .slider li.slick-current").addClass("ani-show") $(".home-ban .slider").on('afterChange', function(event, slick, currentSlide, nextSlide){ $(".home-ban .slider li.slick-current").addClass("ani-show").siblings().removeClass("ani-show") }); $(".business-ban .controls dd").hover(function(){ var e=$(this).index() $(this).addClass("on").siblings().removeClass("on"); $(".business-ban .list li").eq(e).fadeIn().siblings().fadeOut(); $(".business-ban .list li").eq(e).addClass("ani-show").siblings().removeClass("ani-show") $(".business-ban .list").addClass("show") }); $(".business-ban .controls").mouseleave(function(){ $(".business-ban .list").removeClass("show"); $(".business-ban .controls dd").removeClass("on"); $(".business-ban .list li").fadeOut().removeClass("ani-show"); }) } //end } var whirSearch = { one: function(btn, kid, txt, txt1, txt2, txt3, url) { $(btn).jqSearch({ TxtVal: txt, KeyTxt1: txt1, KeyTxt2: txt2, KeyTxt3: txt3, KeyId: kid, //杈撳叆妗唅d KeyUrl: url, //璺宠浆閾炬帴 KeyHref: "key", //閾炬帴浼犲€ Static: false //鏄惁闈欐€佺珯 }); } } var whirOpen = { video:function(){ $(".open-video").click(function(){ var files=$(this).data("files") $(this).parent().siblings().find(".video").remove(); $(this).parent().append("
    "); videoclose(); }); function videoclose(){ $(".video .close").click(function(e) { $(this).parent().remove(); }); } }, open: function(btn, main, css, out) { $(btn).click(function(e) { $(main).toggleClass(css); $(document).on("click", function() { $(main).removeClass(css); }); e.stopPropagation(); }); $(out).on("click", function(e) { e.stopPropagation(); }); }, toggle: function(a, b) { $(a).click(function(e) { $(this).toggleClass("on"); $(b).stop(true, true).fadeToggle(); $(document).on("click", function() { $(b).stop(true, true).fadeOut(); $(a).removeClass("on"); }); e.stopPropagation(); }); $(b).on("click", function(e) { e.stopPropagation(); }); } }